#ifndef STUNTUPLE_H
#define STUNTUPLE_H

#include <memory>
#include <string>

#ifndef IS_WINDOWS
#include <netinet/in.h>
#else
#include <winsock2.h>
#include <Ws2tcpip.h>
#endif

class StunTuple
{
public:
   typedef enum
   {
      None,
      UDP,
      TCP,
      TLS
   } TransportType;

   explicit StunTuple();
   explicit StunTuple(TransportType transport, const asio::ip::address& address, unsigned int port);

   bool operator==(const StunTuple& rhs) const;
   bool operator!=(const StunTuple& rhs) const;
   bool operator<(const StunTuple& rhs) const;

   TransportType getTransportType() const { return mTransport; }
   void setTransportType(TransportType transport) { mTransport = transport; }

   const asio::ip::address& getAddress() const { return mAddress; }
   void setAddress(const asio::ip::address& address) { mAddress = address; }

   unsigned int getPort() const { return mPort; }
   void setPort(unsigned int port) { mPort = port; }

   void toSockaddr(sockaddr* addr) const;

private:
   TransportType mTransport;
   asio::ip::address mAddress;
   unsigned int mPort;

   //friend EncodeStream& operator<<(EncodeStream& strm, const StunTuple& tuple);
};

//EncodeStream& operator<<(EncodeStream& strm, const StunTuple& tuple);

#endif
